package com.example.shopping2.a_c_fragment.car.adapter

import android.widget.CheckBox
import android.widget.RadioButton
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.shopping2.R
import com.example.shopping2.a_c_fragment.car.entity.CarList_Entity

class CarList_Adapter(list:ArrayList<CarList_Entity.DataBean>):BaseQuickAdapter<CarList_Entity.DataBean,BaseViewHolder>(R.layout.car_list,list) {

    override fun convert(holder: BaseViewHolder, item: CarList_Entity.DataBean) {
        holder.setText(R.id.car_item_title,item.goods_desc)
        holder.setText(R.id.car_item_price,"￥"+item.goods_price)
        holder.setText(R.id.car_item_dec,item.goods_sku)
        holder.setText(R.id.car_item_num,""+item.goods_count)
        Glide.with(context).load(item.goods_icon).into(holder.getView(R.id.car_item_img))

        var view = holder.getView<CheckBox>(R.id.car_item_radio)
        view.isChecked = item.selFlag

    }


}